<bc:ExDATA x:Class="LanSunStudio.GUI.DATASystemManagement" 
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                xmlns:exc="clr-namespace:SLS.Controls;assembly=CBSControls" 
                xmlns:bc="clr-namespace:SLS.Base;assembly=CLSBase"
                xmlns:my="clr-namespace:LanSunStudio.GUI"
                x:Name="Container"  ToolTip="{Binding FullName}"
                xmlns:meffed="http:\\www.codeplex.com\MEFedMVVM"            
                >
    <bc:ExDATA.Resources> 
    <!--Update on2012/10/4 21:26:46 -->
    <CollectionViewSource   x:Key="vwBaseTable" Source="{Binding Path=ViewDataSet.SetEnv.SystemManagement}"/>
    <CollectionViewSource   x:Key="vwGoodsTypeKeyDef" Source="{Binding Path=ViewDataSet.SetGlobal.GoodsTypeKeyDef}"/>
    <CollectionViewSource   x:Key="vwGoodsMasterKeyRelation" Source="{Binding Path=ViewDataSet.SetGlobal.GoodsMasterKeyRelation}"/>
    <CollectionViewSource   x:Key="vwGoodsMasterProperty" Source="{Binding Path=ViewDataSet.SetGlobal.GoodsMasterProperty}"/>
    <CollectionViewSource   x:Key="vwGoodsMasterAssemblePoint" Source="{Binding Path=ViewDataSet.SetGlobal.GoodsMasterAssemblePoint}"/>
    <CollectionViewSource   x:Key="vwGTKR" Source="{Binding Path=ViewDataSet.SetGlobal.GTKR}"/>
    <CollectionViewSource   x:Key="vwGTPR" Source="{Binding Path=ViewDataSet.SetGlobal.GTPR}"/>
    <CollectionViewSource   x:Key="vwGTAR" Source="{Binding Path=ViewDataSet.SetGlobal.GTAR}"/>
    <CollectionViewSource   x:Key="vwSystemManagement" Source="{Binding Path=ViewDataSet.SetGlobal.SystemManagement}"/>
    </bc:ExDATA.Resources>  
     <Grid Name="MasterGrid"
          VerticalAlignment="Top"
          HorizontalAlignment="Stretch"
          Width="{Binding ElementName=Container,Path=ActualWidth}">  
    <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />  
        </Grid.RowDefinitions>    
         <StackPanel>
           <WrapPanel>
                <exc:NMICD Name="NMICD"> 
                </exc:NMICD>
                    <TextBlock  
                    Height="23"
                    HorizontalAlignment="Left"
                    Margin="3"
                    Name="KSYSID"
                    Text="{Binding Path=SYSID,Source={StaticResource ResourceKey=vwGoodsTypeKeyDefRelation},   Mode=OneWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                    VerticalAlignment="Center"
                    Width="Auto" 
                    MinWidth="23"/>
                    <TextBlock  
                    Height="23"
                    HorizontalAlignment="Left"
                    Margin="3"
                    Name="KKEYDEFTYPE"
                    Text="{Binding Path=KEYDEFTYPE,Source={StaticResource ResourceKey=vwGoodsTypeKeyDefRelation},   Mode=OneWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                    VerticalAlignment="Center"
                    Width="Auto"
                    MinWidth="23"/>
                    <TextBlock  
                    Height="23"
                    HorizontalAlignment="Left"
                    Margin="3"
                    Name="KGOODSTYPEKEY"
                    Text="{Binding Path=GOODSTYPEKEY,Source={StaticResource ResourceKey=vwGoodsTypeKeyDefRelation},   Mode=OneWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                    VerticalAlignment="Center"
                    Width="Auto"
                    MinWidth="46"
                    />
                    <TextBlock  
                    Height="23"
                    HorizontalAlignment="Left"
                    Margin="3"
                    Name="KGOODSTYPEKEYDEFKEY"
                    Text="{Binding Path=GOODSTYPEKEYDEFKEY,Source={StaticResource ResourceKey=vwGoodsTypeKeyDefRelation},   Mode=OneWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                    VerticalAlignment="Center"
                    Width="Auto" />
                    <TextBlock  
                    Height="23"
                    HorizontalAlignment="Left"
                    Margin="3"
                    Name="KKEYINSTANCETABLE"
                    Text="{Binding Path=KEYINSTANCETABLE,Source={StaticResource ResourceKey=vwGoodsTypeKeyDefRelation},   Mode=OneWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                    VerticalAlignment="Center"
                    Width="Auto" 
                    MinWidth="69"/>                   
                    <ComboBox 
                    HorizontalAlignment="Left"
                    Margin="3"
                    IsEditable="True"
                    StaysOpenOnEdit="True"
                    IsTextSearchEnabled="True"
                    Text="{Binding Path=POSITIONID,Source={StaticResource ResourceKey=vwGoodsTypeKeyDefRelation},   Mode=OneWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                    DisplayMemberPath="POSITIONID"
                    SelectedValuePath="POSITIONID"
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwGoodsTypeKeyDefRelation}}"
                    VerticalAlignment="Center"
                    x:Name="KPOSITIONID"
                    SelectionChanged="cmbKeyRelation_SelectionChanged" 
                    Width="Auto" 
                    MinWidth="69"
                    DropDownOpened="OnDropDownOpened"
                    Tag="GoodsTypeKeyDefRelation" 
                    /> 
                    <Label Grid.Column="0">GoodsKey:</Label>
                    <TextBlock Height="23"
                           HorizontalAlignment="Left"
                           Margin="3"
                           Name="KGOODSKEY"
                           Text="{Binding Path=GOODSKEY,Source={StaticResource ResourceKey=vwGoodsMasterKeyRelation},  Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                           VerticalAlignment="Center"
                           Width="Auto"
                           MinWidth="120" />
                <ComboBox Height="23"
                          IsEditable="True"
                          StaysOpenOnEdit="True"
                          IsTextSearchEnabled="True"
                          Text="{Binding Path=MGOODSKEY,Source={StaticResource ResourceKey=vwGoodsMasterKeyRelation},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwSystemManagement}}"
                          DisplayMemberPath="SYSTEMMANAGEMENTKEY"
                          SelectedValuePath="SYSTEMMANAGEMENTKEY"
                          Tag="SystemManagement"
                          VerticalAlignment="Center"
                          x:Name="mGoodsKey"
                          LostFocus="mGoodsKey_LostFocus"
                          HorizontalAlignment="Stretch"
                          MinWidth="69" 
                          DropDownOpened="OnDropDownOpened"
                    /> 
                <ComboBox Height="23"
                          IsEditable="True"
                          HorizontalAlignment="Stretch"
                          Margin="3"
                          StaysOpenOnEdit="True"
                          IsTextSearchEnabled="True"
                          Text="{Binding Path=SGOODSKEY,Source={StaticResource ResourceKey=vwGoodsMasterKeyRelation},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                          DisplayMemberPath="SYSTEMMANAGEMENTKEY"
                          SelectedValuePath="SYSTEMMANAGEMENTKEY"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwSystemManagement}}"
                          VerticalAlignment="Center"
                          x:Name="sGoodsKey"
                          Tag="SystemManagement"                        
                          LostFocus="sGoodsKey_LostFocus"
                          Width="120"
                          MinWidth="46" 
                          DropDownOpened="OnDropDownOpened"
                        />                    
            </WrapPanel>            
    <exc:FilteringDataGrid 
          Name="MainGridData"
          ItemsSource="{Binding Source={StaticResource ResourceKey=vwBaseTable}}"
          AutoGenerateColumns="False"
          IsSynchronizedWithCurrentItem="True"
          SelectionChanged="MainGridData_SelectionChanged"
          SelectionMode="Extended"
          Height="Auto"
          ColumnWidth="SizeToHeader"
          SelectionUnit="FullRow">
        <DataGrid.Columns>
                    <DataGridTemplateColumn>
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <exc:PopUpMenuTextBox
                                    Name="DATAPopUpMenu"
                                    Loaded="DATAPopUpMenu_Loaded"
                                     />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>        
                <DataGridTextColumn x:Name="SYSTEMID"
                                    Binding="{Binding Path=SYSTEMID}"
                                    Header="SYSTEMID"
                                    Width="SizeToHeader" />
                <DataGridTextColumn x:Name="SYSTEMKEY"
                                    Binding="{Binding Path=SYSTEMKEY}"
                                    Header="SYSTEMKEY"
                                    Width="SizeToHeader" />
                <DataGridTextColumn x:Name="UGOODSKEY"
                                    Binding="{Binding Path=UGOODSKEY}"
                                    Header="UGOODSKEY"
                                    Width="SizeToHeader" />
                <DataGridTextColumn x:Name="LONGDES"
                                    Binding="{Binding Path=LONGDES}"
                                    Header="LONGDES"
                                    Width="SizeToHeader" />
                <DataGridTextColumn x:Name="SHORTDES"
                                    Binding="{Binding Path=SHORTDES}"
                                    Header="SHORTDES"
                                    Width="SizeToHeader" />
                <DataGridTextColumn x:Name="FRSTUSER"
                                    Binding="{Binding Path=FRSTUSER}"
                                    Header="FRSTUSER"
                                    Width="SizeToHeader" />
                <DataGridTextColumn x:Name="FRSTDATE"
                                    Binding="{Binding Path=FRSTDATE}"
                                    Header="FRSTDATE"
                                    Width="SizeToHeader" />
                <DataGridTextColumn x:Name="LASTUSER"
                                    Binding="{Binding Path=LASTUSER}"
                                    Header="LASTUSER"
                                    Width="SizeToHeader" />
                <DataGridTextColumn x:Name="LASTDATE"
                                    Binding="{Binding Path=LASTDATE}"
                                    Header="LASTDATE"
                                    Width="SizeToHeader" />
            </DataGrid.Columns>
          </exc:FilteringDataGrid>  
             </StackPanel>
            <GridSplitter Grid.Row="1"></GridSplitter>            
              <ScrollViewer 
                Grid.Row="2" >
                   <WrapPanel  >                          
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="SYSTEMID:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1"
                                    Grid.Row="0"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="3"
                                    Name="SYSTEMIDTextBox"
                                    Text="{Binding Path=SYSTEMID,Source={StaticResource ResourceKey=vwBaseTable},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                                    VerticalAlignment="Center"
                                    Width="120" />
                        </Grid>
                    </Grid> 
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="SYSTEMKEY:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1"
                                    Grid.Row="0"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="3"
                                    Name="SYSTEMKEYTextBox"
                                    Text="{Binding Path=SYSTEMKEY,Source={StaticResource ResourceKey=vwBaseTable},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                                    VerticalAlignment="Center"
                                    Width="120" />
                        </Grid>
                    </Grid> 
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="UGOODSKEY:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1"
                                    Grid.Row="0"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="3"
                                    Name="UGOODSKEYTextBox"
                                    Text="{Binding Path=UGOODSKEY,Source={StaticResource ResourceKey=vwBaseTable},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                                    VerticalAlignment="Center"
                                    Width="120" />
                        </Grid>
                    </Grid> 
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="LONGDES:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1"
                                    Grid.Row="0"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="3"
                                    Name="LONGDESTextBox"
                                    Text="{Binding Path=LONGDES,Source={StaticResource ResourceKey=vwBaseTable},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                                    VerticalAlignment="Center"
                                    Width="120" />
                        </Grid>
                    </Grid> 
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="SHORTDES:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1"
                                    Grid.Row="0"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="3"
                                    Name="SHORTDESTextBox"
                                    Text="{Binding Path=SHORTDES,Source={StaticResource ResourceKey=vwBaseTable},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                                    VerticalAlignment="Center"
                                    Width="120" />
                        </Grid>
                    </Grid> 
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="FRSTUSER:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1"
                                    Grid.Row="0"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="3"
                                    Name="FRSTUSERTextBox"
                                    Text="{Binding Path=FRSTUSER,Source={StaticResource ResourceKey=vwBaseTable},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                                    VerticalAlignment="Center"
                                    Width="120" />
                        </Grid>
                    </Grid> 
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="FRSTDATE:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                            <DatePicker Grid.Column="1" Grid.Row="0" Height="25" 
                            HorizontalAlignment="Left" Margin="3" 
                            SelectedDate="{Binding Path=FRSTDATE, 
                            Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" 
                            VerticalAlignment="Center" Width="115" />
                            
                        </Grid>
                    </Grid> 
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="LASTUSER:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1"
                                    Grid.Row="0"
                                    Height="23"
                                    HorizontalAlignment="Left"
                                    Margin="3"
                                    Name="LASTUSERTextBox"
                                    Text="{Binding Path=LASTUSER,Source={StaticResource ResourceKey=vwBaseTable},   Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
                                    VerticalAlignment="Center"
                                    Width="120" />
                        </Grid>
                    </Grid> 
                        <Grid>
                        <Grid HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="LASTDATE:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" 
                            VerticalAlignment="Center" />
                            <DatePicker Grid.Column="1" Grid.Row="0" Height="25" 
                            HorizontalAlignment="Left" Margin="3" 
                            SelectedDate="{Binding Path=LASTDATE, 
                            Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" 
                            VerticalAlignment="Center" Width="115" />
                            
                        </Grid>
                    </Grid> 
                    </WrapPanel>
          </ScrollViewer>  
    </Grid>
</bc:ExDATA>
